package com.hd.appcommon.dd.api;

//import com.alibaba.fastjson.JSONObject;
//import com.dingtalk.api.DefaultDingTalkClient;
//import com.dingtalk.api.DingTalkClient;
//import com.dingtalk.api.request.OapiProcessinstanceGetRequest;
//import com.dingtalk.api.response.OapiProcessinstanceGetResponse;
//import com.hd.appcommon.constant.URLConstant;
//import com.hd.appcommon.utils.AccessTokenUtil;
//import com.taobao.api.ApiException;

/**
 * @author: hzp
 * @date: 2022/3/24
 * @description:
 */
public class OAAPI {
//    public static JSONObject getOAFormFromDD(String processInstanceId) {
//        JSONObject oaForm = new JSONObject();
//        String token = AccessTokenUtil.getToken();
//        try {
//            DingTalkClient client = new DefaultDingTalkClient(URLConstant.URL_PROCESSINSTANCE_GET);
//            OapiProcessinstanceGetRequest req = new OapiProcessinstanceGetRequest();
//            req.setProcessInstanceId(processInstanceId);
//            OapiProcessinstanceGetResponse rsp = client.execute(req, token);
//            oaForm = JSONObject.parseObject(rsp.getBody());
//        } catch (ApiException e) {
//            e.printStackTrace();
//        }
//        return oaForm;
//    }
}
